﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Practices.Prism.Events;
using BBInterfaceNET.Events;

namespace BBInterfaceNET.Designer.ViewModels
{
    public class ImageDesignerViewModel:DocumentViewModel
    {
        IEventAggregator eventAggregator;
        public ImageDesignerViewModel(IEventAggregator eventAggregator)
        {
            //FilePath = @"d:\test2.bmp";
            this.eventAggregator = eventAggregator;
        }
        #region IActiveAware overrides
        protected override void OnIsActiveChanged()
        {
            base.OnIsActiveChanged();

            //SaveCommand.IsActive = IsActive;
            //publish the selected field
            if (IsActive)
            {
                eventAggregator.GetEvent<DocumentChangedEvent>().Publish(null);
                eventAggregator.GetEvent<FieldSelectedEvent>().Publish(null);
            }
        }
        #endregion
    }
}
